﻿CREATE PROCEDURE [dbo].[proc_Employee_Attendance_Update]
	(
		@UserName nvarchar(50),
		@TypeId int,
		@KouKuanAmount numeric(18,2),
		@KouKuanFromDate datetime,
		@KouKuanToDate datetime,
		@Description nvarchar(1000),
		@isFlag int,
		@Id int,
		@Days float
	)
AS
	Begin
	
		Declare @CompanyId int,@DepartmentId int,@EName nvarchar(50)
		Set	@CompanyId = (Select CompanyId From Employee Where UserName=@UserName)
		Set	@DepartmentId = (Select DepartmentId From Employee Where UserName=@UserName)
		Set	@EName = (Select EName From Employee Where UserName=@UserName)
		
		Update Employee_Attendance 
								Set UserName=@UserName,
								    EName=@EName,
								    CompanyId=@CompanyId,
								    DepartmentId= @DepartmentId,
								    TypeId=@TypeId,
								    KouKuanAmount=@KouKuanAmount,
								    KouKuanFromDate=@KouKuanFromDate,
								    KouKuanToDate=@KouKuanToDate,
								    Description=@Description,
								    isflag=@isFlag,
								    [Days]=@Days
		Where
				Id=@Id
								  
								    
								    
	End
	RETURN
